package com.th.coupon.service;

import com.th.coupon.common.exception.BaseCloudException;
import com.th.coupon.common.vo.CouponTemplateSdk;
import com.th.coupon.common.vo.SettlementInfo;
import com.th.coupon.entity.Coupon;
import com.th.coupon.vo.AcquireTemplateRequest;

import java.util.List;

/**
 * 用户服务定义
 * @author 涂航
 */
public interface IUserService {

    /**
     *
     * 根据用户id以及状态查询对应的优惠卷
     * @param userId 用户id
     * @param status 用户状态
     * @return {@link Coupon}
     * @throws BaseCloudException
     */
    List<Coupon> findCouponsByStatus(Long userId,Integer status) throws BaseCloudException;


    /**
     *
     * 根据用户id查询当前可领取的优惠卷模板
     * @param userId  用户id
     * @return {@link CouponTemplateSdk}s 优惠卷模板集合
     * @throws BaseCloudException
     */
    List<CouponTemplateSdk> findAvailableTemplate(Long userId) throws BaseCloudException;

    /**
     * 用户领取优惠卷
     * @param acquireTemplateRequest
     * @return {@link Coupon} 优惠卷实体
     * @throws BaseCloudException
     */
    Coupon acquireTemplate(AcquireTemplateRequest acquireTemplateRequest) throws BaseCloudException;

    /**
     * 结算 核销优惠卷
     * @param settlementInfo {@link SettlementInfo}
     * @return {@link SettlementInfo}
     * @throws BaseCloudException
     */
    SettlementInfo settlement(SettlementInfo settlementInfo) throws BaseCloudException;

}
